import '../apis/resquest/http.dart';
import '../model/bean/repairs_list_bean.dart';

class Repairs {
  /// 查询报修待办列表
  /// * [data] Map|请求参数|必填
  static queryRepairsList(Map<String, dynamic> data) async {
    const url = '/elevator-maintenance-app/guarantee/query';
    try {
      HttpResponse _r = await Http.getInstance().post(url, params: data);
      return RepairsListBean.fromJson(_r.data);
    } catch (e) {}
  }

  /// 查询报修待办详情
  /// * [data] Map|请求参数|必填
  static queryRepairsDetails(Map<String, dynamic> data) async {
    const url = '/elevator-maintenance-app/guarantee/getById';
    try {
      HttpResponse _r = await Http.getInstance().get(url, params: data);
      return RepairsBean.fromJson(_r.data);
    } catch (e) {}
  }

  /// 修改报修状态
  /// * [data] Map|请求参数|必填
  static changeStatus(Map<String, dynamic> data) async {
    const url = '/elevator-maintenance-app/guarantee/handle';
    try {
      HttpResponse _r = await Http.getInstance().post(url, params: data);
      return _r.msg;
    } catch (e) {}
  }
}
